﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ProductImageManage.aspx.cs" Inherits="HCFramework.Product.ProductManage.ProductImageManage" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="groupHeader">
        Product images
    </div>
    <div>
        <b>Category:</b> 
        <asp:Literal ID="litCatName" runat="server"></asp:Literal>
        <br />
        <b>Product:</b>
        <asp:Literal ID="litProductName" runat="server"></asp:Literal>
    </div>
    <div>
        <telerik:RadGrid ID="RadGridMain" runat="server" Skin="Office2007" AutoGenerateColumns="False"
            OnItemCommand="RadGridMain_ItemCommand" 
            OnPreRender="RadGridMain_PreRender" ShowFooter="True"
            AllowPaging="True" AllowSorting="True" GridLines="None" 
            onitemdatabound="RadGridMain_ItemDataBound">
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <MasterTableView NoMasterRecordsText="No records.">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductImageId" UniqueName="ProductImageId"
                        Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridImageColumn HeaderText="Image" UniqueName="Image" DataImageUrlFields="URL" DataImageUrlFormatString="{0}" ImageWidth="50" ImageHeight="50">
                    </telerik:GridImageColumn>
                    <telerik:GridTemplateColumn HeaderText="URL" UniqueName="URL">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" Text='<%#Eval("URL")%>' NavigateUrl='<%#Eval("URL")%>' Target="_blank"></asp:HyperLink>
                        </ItemTemplate>
                        <FooterTemplate>
                            URL:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                            Or upload:<asp:FileUpload ID="FileUpload1" runat="server" />
                            <asp:Button ID="Button1" runat="server" Text="Insert" CommandName="Them" />
                        </FooterTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="IsMain">
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButton1" runat="server" CommandName="ChangeMainImage" CommandArgument='<%#Eval("ProductImageId")%>' ImageUrl='<%#Eval("IsMainImage")%>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Xoa" CommandArgument='<%#Eval("ProductImageId")%>' OnClientClick="return confirm('Are you sure to delete this item?');">Delete</asp:LinkButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    <div>
        <asp:LinkButton ID="linkBack" runat="server" onclick="linkBack_Click">Back</asp:LinkButton>
    </div>
</asp:Content>
